package com.candy.control;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloController{

    @RequestMapping("/hello.do")
    public ModelAndView handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception {
        System.out.println("接收到前端传递过来的请求...");
//        创建视图模型
        ModelAndView mv=new ModelAndView();
//        设置视图的名字
//        完整路径应该是：WEB-INF\pages\welcome.jsp
        mv.setViewName("welcome");
        return mv;
    }
}
